#pragma once
#include <iostream>
#include <string>



double sqr (double v);

struct material {
	double density;
	double youngsmodulus;
	double yieldstress;
	double ultimatestress;
	
	
};

material createMaterial(double density, double youngsmodulus, double yield, double ultimate);

class baseobject {
public:
	baseobject(std::string n = "")
		: name(n)
	{
	}
	virtual double inertia() const = 0;
	virtual double centroid() const = 0;
	virtual double weight() const = 0;
	virtual double area() const = 0;

	virtual void displaydata() const = 0;
	std::string& getName()
	{
		return name;
	}
	const std::string& getName() const
	{
		return name;
	}
	void setName(const std::string& N) {
		name = N;
	}
protected:
	std::string name;
};


class object :public baseobject {
public:
	object(double w, double t, double l, material mat);

	virtual void displaydata() const;


	double& getWidth()
	{
		return width;
	}
	const double& getWidth() const
	{
		return width;
	}
	void setWidth(double w)
	{
		width = w / 1000;
	}
	double& getLength()
	{
		return length;
	}
	const double& getLength() const
	{
		return length;
	}
	void setLength(double l)
	{
		length = l / 1000;
	}
	double& getThickness()
	{
		return thickness;
	}
	const double& getThickness() const
	{
		return thickness;
	}
	void setThickness(double t)
	{
		thickness = t / 1000;
	}
	material& getMaterial()
	{
		return m;
	}
	const material& getMaterial() const
	{
		return m;
	}


protected:
	double width;
	double length;

	material m;
	double thickness;
};